﻿<%@ Page Language="C#" MasterPageFile="~/AdminMaster.Master" AutoEventWireup="True"
    CodeBehind="Member.aspx.cs" Inherits="MyWeb.Admins.Member" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="PageName">
        Danh sách thành viên</div>
    <asp:Panel ID="pnView" runat="server">
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton CssClass="vadd" ID="lbtAddT" runat="server" OnClick="AddButton_Click">Thêm mới</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vdelete" ID="lbtDeleteT" runat="server" OnClick="DeleteButton_Click">Xóa</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshT" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton></li>
                <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở
                    lại</a> </li>
            </ul>
        </div>
        <asp:DataGrid ID="grdMember" runat="server" Width="100%" CssClass="TableView" AutoGenerateColumns="False"
            AllowPaging="True" PageSize="30" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Center"
            OnItemDataBound="grdMember_ItemDataBound" OnItemCommand="grdMember_ItemCommand"
            OnPageIndexChanged="grdMember_PageIndexChanged">
            <HeaderStyle CssClass="trHeader"></HeaderStyle>
            <ItemStyle CssClass="trOdd"></ItemStyle>
            <AlternatingItemStyle CssClass="trEven"></AlternatingItemStyle>
            <Columns>
                <asp:TemplateColumn ItemStyle-CssClass="tdCenter">
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkSelectAll" runat="server" AutoPostBack="False"></asp:CheckBox>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle CssClass="tdCenter"></ItemStyle>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="Id" HeaderText="Id" Visible="False" />
                <asp:BoundColumn DataField="Active" HeaderText="Active" Visible="False" />
                <asp:BoundColumn DataField="Username" HeaderText="Tên đăng nhập" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="Password" HeaderText="Mật khẩu" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="Name" HeaderText="Họ tên" ItemStyle-CssClass="Text" Visible="true" />
                <asp:TemplateColumn ItemStyle-CssClass="DateTime">
                    <HeaderTemplate>
                        Ngày sinh</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# MyWeb.Common.DateTimeClass.ConvertDateTime(DataBinder.Eval(Container.DataItem, "Birthday").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="Email" HeaderText="Email" ItemStyle-CssClass="Text" Visible="true" />
                <asp:BoundColumn DataField="Phone" HeaderText="Di động" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="Company" HeaderText="Công ty" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="Taxcode" HeaderText="Mã số thuế" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="WebsiteCompany" HeaderText="Website công ty" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="PhoneCompany" HeaderText="Website công ty" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="Fax" HeaderText="Số Fax công ty" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="DirectorName" HeaderText="Tên giám đốc" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="DirectorPhone" HeaderText="Điện thoại giám đốc" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:TemplateColumn ItemStyle-CssClass="DateTime">
                    <HeaderTemplate>
                        Ngày đăng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# MyWeb.Common.DateTimeClass.ConvertDateTime(DataBinder.Eval(Container.DataItem, "CreateDate").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Active">
                    <HeaderTemplate>
                        Kích hoạt</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblStatus" runat="server" Text='<%# MyWeb.Common.PageHelper.ShowActiveStatus(DataBinder.Eval(Container.DataItem, "Active").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Function">
                    <HeaderTemplate>
                        Chức năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="cmdEdit" runat="server" AlternateText="Sửa" CommandName="Edit"
                            CssClass="Edit" ToolTip="Sửa" ImageUrl="/App_Themes/Admin/images/edit.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>' /><asp:ImageButton
                                ID="cmdDelete" runat="server" AlternateText="Xóa" CommandName="Delete" CssClass="Delete"
                                ToolTip="Xóa" ImageUrl="/App_Themes/Admin/images/delete.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>'
                                OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" /><asp:ImageButton
                                    ID="cmdActive" runat="server" AlternateText='<%#MyWeb.Common.PageHelper.ShowActiveToolTip(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    CommandName="Active" CssClass="Active" ToolTip='<%# MyWeb.Common.PageHelper.ShowActiveToolTip(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    ImageUrl='<%#MyWeb.Common.PageHelper.ShowActiveImage(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>' /></ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <PagerStyle HorizontalAlign="Center" CssClass="Paging" Position="Bottom" NextPageText="Previous"
                PrevPageText="Next" Mode="NumericPages"></PagerStyle>
        </asp:DataGrid>
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton CssClass="vadd" ID="lbtAddB" runat="server" OnClick="AddButton_Click">Thêm mới</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vdelete" ID="lbtDeleteB" runat="server" OnClick="DeleteButton_Click">Xóa</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshB" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton></li>
                <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở
                    lại</a> </li>
            </ul>
        </div>
    </asp:Panel>
    <asp:Panel ID="pnUpdate" runat="server" Visible="False">
        <table class="TableUpdate" border="1">
            <tr>
                <td class="Control" colspan="2">
                    <ul>
                        <li>
                            <asp:LinkButton CssClass="uupdate" ID="lbtUpdateT" runat="server" OnClick="Update_Click">Ghi lại</asp:LinkButton></li>
                        <li>
                            <asp:LinkButton CssClass="uback" ID="lbtBackT" runat="server" OnClick="Back_Click"
                                CausesValidation="False">Trở về</asp:LinkButton></li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblUsername" runat="server" Text="Tên đăng nhập:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtUsername" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblPassword" runat="server" Text="Mật khẩu:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtPassword" runat="server" CssClass="text" 
                        TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblName" runat="server" Text="Họ tên:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtName" runat="server" CssClass="text"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfvName" runat="server" ControlToValidate="txtName" Display="Dynamic" ErrorMessage="*"
                        SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblBirthday" runat="server" Text="Ngày sinh:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtBirthday" runat="server" CssClass="text datetime" />
                    <asp:CalendarExtender ID="txtBirthday_CalendarExtender" runat="server" 
                        TargetControlID="txtBirthday">
                    </asp:CalendarExtender>
                    <asp:MaskedEditExtender
                        ID="meeBirthday" runat="server" Mask="99/99/9999 99:99:99" MaskType="DateTime"
                        OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" TargetControlID="txtBirthday"
                        AcceptAMPM="True" Century="2000" />
                    <asp:MaskedEditValidator ID="mevBirthday" runat="server" ControlExtender="meeBirthday"
                        ControlToValidate="txtBirthday" Display="Dynamic" EmptyValueBlurredText="Date and time is required"
                        IsValidEmpty="True" InvalidValueBlurredMessage="Date and time is invalid" SetFocusOnError="True" />
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblEmail" runat="server" Text="Email:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtEmail" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblPhone" runat="server" Text="Di động:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtPhone" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblCompany" runat="server" Text="Công ty:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtCompany" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblTaxcode" runat="server" Text="Mã số thuế:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtTaxcode" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblWebsiteCompany" runat="server" Text="Website công ty:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtWebsiteCompany" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblPhoneCompany" runat="server" Text="Website công ty:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtPhoneCompany" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblFax" runat="server" Text="Số Fax công ty:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtFax" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblDirectorName" runat="server" Text="Tên giám đốc:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtDirectorName" runat="server" CssClass="text"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfvDirectorName" runat="server" ControlToValidate="txtDirectorName" Display="Dynamic"
                        ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblDirectorPhone" runat="server" Text="Điện thoại giám đốc:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtDirectorPhone" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblCreateDate" runat="server" Text="Ngày đăng:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtCreateDate" runat="server" CssClass="text datetime" /><asp:MaskedEditExtender
                        ID="meeCreateDate" runat="server" Mask="99/99/9999 99:99:99" MaskType="DateTime"
                        OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" TargetControlID="txtCreateDate"
                        AcceptAMPM="True" Century="2000" />
                    <asp:MaskedEditValidator ID="mevCreateDate" runat="server" ControlExtender="meeCreateDate"
                        ControlToValidate="txtCreateDate" Display="Dynamic" EmptyValueBlurredText="Date and time is required"
                        IsValidEmpty="True" InvalidValueBlurredMessage="Date and time is invalid" SetFocusOnError="True" />
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblActive" runat="server" Text="Kích hoạt:"></asp:Label>
                </th>
                <td>
                    <asp:CheckBox ID="chkActive" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="Control" colspan="2">
                    <ul>
                        <li>
                            <asp:LinkButton CssClass="uupdate" ID="lbtUpdateB" runat="server" OnClick="Update_Click">Ghi lại</asp:LinkButton></li>
                        <li>
                            <asp:LinkButton CssClass="uback" ID="lbtBackB" runat="server" OnClick="Back_Click"
                                CausesValidation="False">Trở về</asp:LinkButton></li>
                    </ul>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
